import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AuditVO, AuditForm, AuditQuery } from '@/api/business/audit/types';

/**
 * 查询提现审核列表
 * @param query
 * @returns {*}
 */

export const listAudit = (query?: AuditQuery): AxiosPromise<AuditVO[]> => {
  return request({
    url: '/business/audit/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询提现审核详细
 * @param auditId
 */
export const getAudit = (auditId: string | number): AxiosPromise<AuditVO> => {
  return request({
    url: '/business/audit/' + auditId,
    method: 'get'
  });
};

/**
 * 新增提现审核
 * @param data
 */
export const addAudit = (data: AuditForm) => {
  return request({
    url: '/business/audit',
    method: 'post',
    data: data
  });
};

/**
 * 修改提现审核
 * @param data
 */
export const updateAudit = (data: AuditForm) => {
  return request({
    url: '/business/audit',
    method: 'put',
    data: data
  });
};

/**
 * 删除提现审核
 * @param auditId
 */
export const delAudit = (auditId: string | number | Array<string | number>) => {
  return request({
    url: '/business/audit/' + auditId,
    method: 'delete'
  });
};
